load(key).

use_package(hypspc).
minimal_cases(2).
random_test_set(0.1).
accuracy(0.80).

classes([pos,neg]).
predict(active(+drug,-class)).

rmode(1: lumo(+Drug,-Number)).
rmode(1: logp(+Drug,-Number)).	
rmode(1: bond(+Drug,+Atomid,-Atomid,-Number)).
rmode(1: atm(+Drug,-Atomid, #,-Number,-Number)).
rmode(1: benzene(+Drug,-Ring)).
rmode(1: carbon_5_aromatic_ring(+Drug,-Ring)).
rmode(1: carbon_6_ring(+Drug,-Ring)).
rmode(1: hetero_aromatic_6_ring(+Drug,-Ring)).
rmode(1: hetero_aromatic_5_ring(+Drug,-Ring)).
rmode(1: ring_size_6(+Drug,-Ring)).
rmode(1: ring_size_5(+Drug,-Ring)).
rmode(1: nitro(+Drug,-Ring)).
rmode(1: methyl(+Drug,-Ring)).
rmode(1: anthracene(+Drug,-Ringlist)).
rmode(1: phenanthrene(+Drug,-Ringlist)).
rmode(1: ball3(+Drug,-Ringlist)).
rmode(1: member(-Ring,+Ringlist)).
rmode(1: member(+Ring,+Ringlist)).
rmode(1: connected(+Ring,+Ring)).



typed_language(yes).
type(lumo(drug,number)).
type(logp(drug,number)).
type(bond(drug,atomid,atomid,number)).
type(atm(drug,atomid,element,number,number)).
type(number =< number).
type(number >= number).
type(benzene(drug,ring)).
type(carbon_5_aromatic_ring(drug,ring)).
type(carbon_6_ring(drug,ring)).
type(hetero_aromatic_6_ring(drug,ring)).
type(hetero_aromatic_5_ring(drug,ring)).
type(ring_size_6(drug,ring)).
type(ring_size_5(drug,ring)).
type(nitro(drug,ring)).
type(methyl(drug,ring)).
type(anthracene(drug,ringlist)).
type(phenanthrene(drug,ringlist)).
type(ball3(drug,ringlist)).
type(member(ring,ringlist)).
type(member(ring,ringlist)).
type(connected(ring,ring)).


auto_lookahead(lumo(Drug,Number),[Number]).
auto_lookahead(logp(Drug,Number),[Number]).
% auto_lookahead(bond(Drug,Atomid,Atomid,Number),[Number]).
auto_lookahead(atm(Drug,Atomid,Element,Number1,Number2),[Number1]).
auto_lookahead(atm(Drug,Atomid,Element,Number1,Number2),[Number2]).

discretize(entropy).

discretization(bounds(4)).

to_be_discretized(lumo(Drug,Number),[Number]).
rmode(1: #(C:threshold(lumo(_,Number), [Number], C), +Number >= C)).
rmode(1: #(C:threshold(lumo(_,Number), [Number], C),+Number =< C)).



to_be_discretized(logp(Drug,Number),[Number]).
rmode(1: #(C:threshold(logp(_,Number), [Number], C), +Number >= C)).
rmode(1: #(C:threshold(logp(_,Number), [Number], C),+Number =< C)).


/*
to_be_discretized(bond(Drug,Atomid, Atomid, Number),[Number]).
rmode(1: #(C:threshold(bond(_,_,_,Number), [Number], C), +Number >= C)).
rmode(1: #(C:threshold(bond(_,_,_,Number), [Number], C), +Number =< C)).
*/

to_be_discretized(atm(Drug,Atomid,Element,Number1, Number2),[Number1]).
rmode(1: #(C:threshold(atm(_,_,_,_,Number1), [Number1], C), +Number1 >= C)).
rmode(1: #(C:threshold(atm(_,_,_,_,Number1), [Number1], C),+Number1 =< C)).


to_be_discretized(atm(Drug,Atomid,Element,Number1, Number2),[Number2]).
rmode(1: #(C:threshold(atm(_,_,_,Number2,_), [Number2], C), +Number2 >= C)).
rmode(1: #(C:threshold(atm(_,_,_,Number2,_), [Number2], C),+Number2 =< C)).







